package com.ruov.plugin.wx.offiaccount.handler;

import com.ruov.common.core.redis.RedisCache;
import lombok.AllArgsConstructor;
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author wjsmc
 * @date 2025/4/24 14:52
 * @description
 **/

@Component
@AllArgsConstructor
public class CallbackHandler {


    private final RedisCache redisCache;


    @Bean
    @ConditionalOnMissingBean(LogHandler.class)
    public LogHandler logHandler() {
        return new LogHandler();
    }

    @Bean
    @ConditionalOnMissingBean(MsgHandler.class)
    public MsgHandler msgHandler() {
        return new MsgHandler();
    }

    @Bean
    @ConditionalOnMissingBean(ScanHandler.class)
    public ScanHandler scanHandler() {
        return new ScanHandler(redisCache);
    }
}
